﻿using ElectronicWMSA.Comm.Forms.Message;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using WMSADBUtility;

namespace ElectronicWMSA.List.Second
{
    public partial class UPS_Insert : Form
    {
        public UPS_Insert()
        {
            InitializeComponent();
        }

        #region 按钮：退出
        private void bt_Cancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }
        #endregion

        string Tracking_No = "";
        string Model_No = "";
        string Serial_No = "";
        string City = "";

        #region 按钮：确定
        private void bt_confirm_Click(object sender, EventArgs e)
        {

            if (MessageClass.enquire("是否确定要插入此数据？") == DialogResult.OK)
            {
                Tracking_No = tb_Tracking_No.Text;
                Model_No = tb_Model_No.Text;
                Serial_No = tb_Serial_No.Text;
                City = tb_City.Text;

                string sql = "insert into [T_UPS_Excel_Manage] (Tracking_No,Model_No,Serial_No,City,Create_Time)values" +
                               "('" + Tracking_No + "','" + Model_No + "','" + Serial_No + "','" + City + "','" + DateTime.Now + "' )";
                int result = DBHelper.ExecuteSql(sql);

                if (result > 0)
                {
                    MessageClass.right("插入成功");
                    this.Close();
                }

            }

        }
        #endregion
    }
}
